package part18;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;

/**
 * @author wcj
 * @Date 2021/6/3 17:24
 * @Version 1.0
 */
public class Part189 {

    /**
     * IO流的经典使用方式之三：利用DataInputStream实现字符的读取
     *
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        DataInputStream in = new DataInputStream(new ByteArrayInputStream(Part187.read("./src/part18/Part189.java").getBytes()));
        while (in.available() != 0) {
            System.out.println((char) in.readByte());
        }
    }
}
